# -*- coding: utf-8 -*-
# @Time         : 14:03 2025/2/26
# @Author       : Chris
# @Description  :
from typing import Optional, List

from .product import FlashSaleType, ProductType, Industry, StuffStatus
from .product_create_params import InspectData
from .product_detail import AdventData, BookData
from .product_detail import BrandData, ChannelPV
from .product_detail import FoodData
from .product_detail import Image
from .product_detail import PublishShop
from .product_detail import ReportData, SkuImage, SkuInfo
from .._models import BaseModel


class SkuEdition(SkuInfo):
    sku_text: str
    """SKU规格
    格式 : 规格:属性，多个时使用";"拼接。如:颜色:白色;容量:128G
    示例值:
    颜色:黑色;内存:512G
    """


class ProductEditParams(BaseModel):
    """管家商品ID"""
    product_id: int
    """管家商品ID"""

    advent_data: Optional[AdventData] = None
    """闲鱼特卖信息, 闲鱼特卖类型为临期非食品行业时必传"""

    book_data: Optional[BookData] = None
    """图书信息"""

    brand_data: Optional[BrandData] = None
    """品牌捡漏信息"""

    category_id: Optional[int] = None
    """商品分类"""

    channel_cat_id: Optional[str] = None
    """商品类目ID"""

    channel_pv: Optional[List[ChannelPV]] = None
    """商品属性"""

    detail_images: Optional[List[Image]] = None
    """详情图片"""

    express_fee: Optional[int] = None
    """运费"""

    flash_sale_type: Optional[FlashSaleType] = None
    """闲鱼特卖类型"""

    food_data: Optional[FoodData] = None
    """食品信息"""

    inspect_data: Optional[InspectData] = None
    """验货宝信息, 商品类型为验货宝时必传"""

    item_biz_type: Optional[ProductType] = None
    """商品类型ID"""

    notify_url: Optional[str] = None
    """回调地址, 仅在商品状态为在架中编辑时，才会触发回调通知。
    回调参数请查看推送目录下的商品回调通知文档。
    """

    original_price: Optional[int] = None
    """商品原价（分）"""

    outer_id: Optional[str] = None
    """商家编码, 注意：一个中文按2个字符算"""

    price: Optional[int] = None
    """商品售价（分）, 注意：多规格商品时，必须是SKU其中一个金额"""

    publish_shop: Optional[List[PublishShop]] = None
    """发布店铺"""

    report_data: Optional[ReportData] = None
    """验货报告信息"""

    sku_images: Optional[List[SkuImage]] = None
    """规格图片"""

    sku_items: Optional[List[SkuEdition]] = None
    """商品多规格信息"""

    sp_biz_type: Optional[Industry] = None
    """商品分类ID"""

    stock: Optional[int] = None
    """商品库存, 注意：多规格商品，必须是SKU库存的合计"""

    stuff_status: Optional[StuffStatus] = None
    """商品成色"""
